<include file="public/header" />
<include file="public/left" />
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
	<div class="flexigrid">
		<div class="mDiv">
			<div class="ftitle">
				<h3>商户列表</h3>
				<h5>(共{$count}条记录)</h5>
			</div>
			<div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
			<form class="navbar-form form-inline" action="" method="get">
				<div class="sDiv">
					<div class="sDiv2">
						<input type="text" class="qsbox" name="keyword" placeholder="可搜索昵称或手机号码" value="{$keyword}">
						<input  class="btn"type="submit" value="搜索">
					</div>
				</div>
			</form>
		</div>

		<div class="hDiv">
			<div class="hDivBox">
				<table cellspacing="0" cellpadding="0">
					<thead>
					<tr>
						<th class="sign" axis="col0">
							<div style="width: 24px;"><i class="ico-check"></i></div>
						</th>
						<th align="left" abbr="ac_id" axis="col4" class="">
							<div style="text-align: left; width: 100px;" class="">姓名</div></th>
						<th align="left" abbr="ac_id" axis="col4" class="">
							<div style="text-align: left; width: 100px;" class="">手机号码</div></th>
						<th align="left" abbr="ac_id" axis="col4" class="">
							<div style="text-align: left; width: 150px;" class="">身份证号</div></th>
						<th align="left" abbr="ac_id" axis="col4" class="">
							<div style="text-align: left; width: 150px;" class="">银行卡号</div></th>
						<th align="left" abbr="ac_id" axis="col4" class="">
							<div style="text-align: left; width: 200px;" class="">店铺名称</div></th>
						<th align="left" abbr="ac_id" axis="col4" class="">
						<div style="text-align: left; width: 250px;" class="">店铺地址</div></th>
						<th align="left" abbr="ac_id" axis="col4" class="">
						<div style="text-align: left; width: 60px;" class="">佣金(%)</div></th>
						<th align="left" abbr="ac_id" axis="col4" class="">
							<div style="text-align: left; width: 90px;" class="">排序(点击修改)</div></th>
						<th align="left" abbr="ac_id" axis="col4" class="">
							<div style="text-align: left; width: 90px;" class="">店铺状态</div></th>
						<th align="center" axis="col1" class="handle">
							<div style="text-align: center; width: 250px;">操作</div>
						</th>
						<!--<th style="width:100%" axis="col7">
							<div></div>
						</th>-->
					</tr>
					</thead>
				</table>
			</div>
		</div>
		<div class="bDiv" style="height: auto;">
			<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
				<table>
					<tbody>
					<foreach name="list" item="vo" key="k" >
						<tr>
							<td class="sign">
								<div style="width: 24px;"><i class="ico-check"></i></div>
							</td>
							<td align="left" class="">
								<div style="text-align: left; width: 100px;">{$vo.realname}</div>
							</td>
							<td align="left" class="">
								<div style="text-align: left; width: 100px;">{$vo.mobile}</div>
							</td>
							<td align="left" class="">
								<div style="text-align: left; width: 150px;">{$vo.idcard}</div>
							</td>
							<td align="left" class="">
								<div style="text-align: left; width: 150px;">{$vo.bankcard}</div>
							</td>
							<td align="left" class="">
								<div style="text-align: left; width: 200px;">{$vo.shopname}</div>
							</td>
							<td align="left" class="">
								<div style="text-align: left; width: 250px;">{$vo.province}{$vo.city}{$vo.county}{$vo.address}</div>
							</td>
							<td align="left" class="">
								<div style="text-align: left; width: 60px;"><if condition="!empty($vo.commission)">{$vo.commission}<else/>0</if></div>
							</td>
							<td align="left" class="">
								<div style="text-align: left; width: 90px;"><span title="点击可编辑，enter键确认修改"  style="display:block;width: 80px;" class="sort">{$vo.sort}</span><input class="sort_input"  style="width: 80px" type="hidden"  data-id="{$vo.id}" value="{$vo.sort}"></div>
							</td>
							<td align="left" class="">
								<div style="text-align: left; width: 90px;"><span t style="display:block;width: 80px;" ><switch name="vo.status">
									<case value="0"><span style="color:red">待审核</span></case>
									<case value="1"><span style="color:green">已通过</span></case>
									<case value="2"><span style="color:red">修改店铺</span></case>
									<case value="3"><span style="color:red">修改店址</span></case>
									<case value="-1"><span style="color:#ccc">不通过</span></case>
								</switch></span></div>
							</td>
							<td align="center" class="handle">
								<div style="text-align: center; width: 250px;">
									<a href="{:url('Set/banner',array('shop_id'=>$vo['id']))}" class="btn blue"><i class="fa fa-pencil-square-o"></i>店铺轮播图</a>
									<a href="{:url('Set/activity',array('shop_id'=>$vo['id']))}" class="btn blue"><i class="fa fa-pencil-square-o"></i>首页活动专区</a>
								</div>
							</td>
							<td align="" class="" style="width: 100%;">
								<div>&nbsp;</div>
							</td>
						</tr>
					</foreach>
					</tbody>
				</table>
			</div>
			<div class="iDiv" style="display: none;"></div>
		</div>
		{$list->render()}
		<!--分页位置-->
	</div>
</div>
<script>
	$(document).ready(function(){
		// 表格行点击选中切换
		$('#flexigrid > table>tbody >tr').click(function(){
			$(this).toggleClass('trSelected');
		});
		// 点击刷新数据
		$('.pReload').click(function(){
			location.href = location.href;
		});
		$(".sort").click(function(){
			$(this).hide();
			$(this).siblings("input").prop("type","number");
		});
		$(".sort_input").keydown(function(e){
			var ev = document.all ? window.event : e;
			if (ev.keyCode == 13) {
				var str = $(this);
				var id = $(this).data("id");
				var num = new Number($(this).val());
				//var num = a.toFixed(2);
				$.post("{:url('merchant/sort')}", {id: id, num: num}, function (result) {
					if (result == 1) {
						str.prop("type", "hidden");
						str.val(num);
						str.siblings("span").show();
						str.siblings("span").html(num);
					} else {
						alert('系统繁忙，稍后再试');
					}
				});

			}
		})
	});
	function checkfun(obj) {
		// 删除按钮
		var confirm=$(obj).attr('data-name');
		layer.confirm(confirm, {
			btn: ['确定', '取消'] //按钮
		}, function () {
			$.ajax({
				type: 'post',
				url: $(obj).attr('data-url'),
				data : {id:$(obj).attr('data-id'),status:$(obj).attr('data-status')},
				dataType: 'json',
				success: function (data) {
					if (data == 1) {
						window.location.reload();
					} else {
						layer.alert(data, {icon: 2});  //alert('删除失败');
					}
				}
			})
		}, function () {
		});
	}
	function recommend(obj) {
		// 删除按钮
		var confirm=$(obj).attr('data-name');
		layer.confirm(confirm, {
			btn: ['确定', '取消'] //按钮
		}, function () {
			$.ajax({
				type: 'post',
				url: $(obj).attr('data-url'),
				data : {id:$(obj).attr('data-id')},
				dataType: 'json',
				success: function (data) {
					if (data == 1) {
						window.location.reload();
					} else {
						layer.alert('操作失败', {icon: 2});  //alert('删除失败');
					}
				}
			})
		}, function () {
		});
	}

</script>
</body>
</html>
</html>